package com.zr.sms.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.sms.service.FindEmpService;
import com.zr.sms.serviceimpl.FindEmpServiceImpl;

/**
 * 
 * @author Administrator 谭笑傲
 *
 */
public class DeleteEmpServlet extends HttpServlet{
	FindEmpService findempservice = new FindEmpServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		resp.setCharacterEncoding("UTF-8");
		String eid = req.getParameter("eids");
		
		String eids[] = eid.split(",");
		int flag = findempservice.deleteEmp(eids);
		PrintWriter pw = resp.getWriter();
		pw.write(String.valueOf(flag));
	}
}